import java.util.List;
import java.util.ArrayList;

// Teacher类（继承Person）
public class Teacher extends Person {
    // 修正：泛型改为Course（存储授课课程）
    private List<Course> taughtCourses;

    // 构造方法
    public Teacher(String id, String name) {
        super(id, name);
        this.taughtCourses = new ArrayList<>();
    }

    // 添加授课课程
    public void addTaughtCourse(Course course) {
        this.taughtCourses.add(course);
    }

    // 重写打印方法
    @Override
    public void printWorksheet() {
        super.printWorksheet();
        System.out.println("教师授课表：");
        for (Course course : taughtCourses) {
            System.out.println("- " + course.getCourseName() + "（课程ID：" + course.getCourseId() + "）");
        }
    }
}